package hotsaucerecipes

class Review {
    String title
    String comments
    Integer rating
    Date dateCreated

    static belongsTo = [recipe: Recipe]

    static constraints = {
        title(blank: false, maxSize: 100)
        rating()
        comments(widget: 'textarea', maxSize: 1000)
        rating(min: 1, max: 5)
        dateCreated()
    }

    String toString() {
        return "${title}, : ${rating} out of 5"
    }
}
